# !/usr/bin/env python
# encoding: utf-8
'''
  @author: HJW
  @license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited.
  @contact: hejunwang01@126.com
  @file: proxy.py
  @time: 2022/8/17 0017 下午 23:27
  @desc:  代理 ip
  代理IP的类型 :
   http:
   https: 引用到https的url
  '''

import requests
url = "https://www.baidu.com"
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
}
 #构建代理ip
proxies = {
    # "http": "http://" + '112.5.56.2:9091',
    "https": "https://" + '112.5.56.2:9091',
    # "http": proxy,
    # "https": proxy,
}

def proxi():
    page_next = requests.get(url=url,headers =headers,proxies=proxies).text
    with open("./a.html",'w',encoding="utf-8") as fp:
        fp.write(page_next)





if __name__ == '__main__':
    proxi()






